package cn.com.zero.common.auth.security.po;

import cn.com.zero.base.po.BasePO;

import java.util.Date;

/**
 * @author xiongxj
 * @version 1.0.0
 * @Description 登录日志PO类
 * @createTime 2023/3/27 9:40
 */
public class LoginLogPO extends BasePO {

    private static final long serialVersionUID = -4115759166356409261L;
    /**
     * 用户Id
     */
    private String userId;

    /**
     * 登录设备
     */
    private String loginDevice;

    /**
     * 登录IP
     */
    private String loginIp;

    /**
     * 登录退出类型（0：登录  1：退出）
     */
    private Integer type;

    /**
     * 操作结果（1：成功 -1：失败）
     */
    private Integer result;

    /**
     * 备注信息
     */
    private String remark;

    /**
     * 登录时间
     */
    private Date loginTime;

    /**
     * 构造函数
     */
    public LoginLogPO() {
    }

    /**
     * 构造函数
     *
     * @param userId      用户Id
     * @param loginDevice 登录设备
     * @param loginIp     登录ip
     * @param loginTime   登录时间
     */
    public LoginLogPO(String userId, String loginDevice, String loginIp, Date loginTime) {
        this.userId = userId;
        this.loginDevice = loginDevice;
        this.loginIp = loginIp;
        if (null == loginTime) {
            this.loginTime = new Date();
        } else {
            this.loginTime = loginTime;
        }

    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getLoginDevice() {
        return loginDevice;
    }

    public void setLoginDevice(String loginDevice) {
        this.loginDevice = loginDevice;
    }

    public String getLoginIp() {
        return loginIp;
    }

    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getResult() {
        return result;
    }

    public void setResult(Integer result) {
        this.result = result;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }
}
